echo "Definitions des variables d'environnement du workspace"
source /opt/ros/electric/setup.bash
ROS_ROOT=/opt/ros/electric/ros
PATH=$ROS_ROOT/bin:$PATH
PYTHONPATH=$ROS_ROOT/core/roslib/src:$PYTHONPATH
ROS_PACKAGE_PATH=~/ros_workspace:/opt/ros/electric/stacks:$ROS_PACKAGE_PATH


echo Arret du service turtlebot
sudo echo " "
sudo service turtlebot stop&
sleep 4
killall -9 python

echo "Definition des adresses IP"
#Ad hoc
#ROS_MASTER_URI=http://10.42.43.1:11311
#ROS_HOSTNAME=10.42.43.88
#export ROS_MASTER_URI=http://10.42.43.1:11311
#export ROS_HOSTNAME=10.42.43.88

#EDUROAM
#ROS_MASTER_URI=http://192.168.1.100:11311
#ROS_HOSTNAME=172.19.130.44
export ROS_MASTER_URI=http://192.168.1.100:11311
export ROS_HOSTNAME=192.168.1.101

echo ROS_MASTER_URI=$ROS_MASTER_URI
echo ROS_HOSTNAME=$ROS_HOSTNAME


echo "Parametrage de l interface reseau"
roscd turtlebot_bringup/upstart/
sudo ./install.bash wlan0

sleep 2

echo "Redemarrage service turtlebot"

sudo service turtlebot start
sleep 4
echo Noeud actifs sur le turtlebot \:
rosnode list -a
cd

echo Lancement de la dashboard
rosrun turtlebot_dashboard turtlebot_dashboard&
sleep 2
echo Appuyez sur une touche pour lancer le controle \du turtlebot ou Ctrl+C pour arreter
echo Lancement de la visualisation
rosrun UniceBot depth_viewer&
sleep 2
echo Lancement de la telecommande
roslaunch turtlebot_teleop keyboard_teleop.launch
